package sample.web.thymeleaf3.mvc;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import sample.web.thymeleaf3.Message;

/**
 * Created by wudi on 2016/12/22.
 */
@Controller
@RequestMapping("/")
public class IndexController {

    @GetMapping("{id}")
    public ModelAndView view(@PathVariable("id") String message) {
        return new ModelAndView("messages/"+message, "message", message);
    }

}
